package com.yzc.mihuyou.controller;


import com.yzc.mihuyou.service.ComtyService;
import com.yzc.mihuyou.vo.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.util.HashMap;
import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author yzc
 * @since 2022-05-05
 */
@RestController
@RequestMapping("/mihuyou/comty")
public class ComtyController {
    @Autowired
    ComtyService comtyService;

    @GetMapping("cuimg/{id}")
    public JsonResult cuimg(@PathVariable("id") int id){
        Map<String,Object> map=new HashMap<>();
        map.put("cuimg",comtyService.comList(id));
        return  new  JsonResult(200,"查询成功",map);
    }

    @PostMapping("tiezi")
    public  String text(@RequestPart("photos") MultipartFile photos){
        comtyService.importProfession(photos);
        return "";
    }
}
